<?php
declare(strict_types=1);

namespace SixShop\Payment\Enum;


enum NumberBizEnum: int
{
    case ORDER_NO = 1;
    case ORDER_PAY = 2;
    case ORDER_REFUND = 3;
    case WITHDRAWAL = 4;
    case VIP_PAY = 5;
    case PROFIT_SHARE_RECEIVER = 6;
    case PROFIT_SHARE_ORDER = 7;

    public function toString(): string
    {
        return match ($this) {
            self::ORDER_NO => '订单号',
            self::ORDER_PAY => '订单支付',
            self::ORDER_REFUND => '订单退款',
            self::WITHDRAWAL => '提现',
            self::VIP_PAY => 'VIP支付',
            self::PROFIT_SHARE_RECEIVER => '分润接收申请单',
            self::PROFIT_SHARE_ORDER => '分润订单'
        };
    }

    public static function fromPaymentBiz(PaymentBizEnum $biz): self
    {
        return match ($biz) {
            PaymentBizEnum::ORDER_PAY => self::ORDER_PAY,
            PaymentBizEnum::VIP_PAY => self::VIP_PAY,
        };
    }
}